package com.orphan.marketBack.controller;

import com.orphan.marketBack.po.OrderReturn;
import com.orphan.marketBack.service.ReturnOrderService;
import com.orphan.marketBack.service.impl.ReturnOrderServiceImpl;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
public class ReturnOrderController {
    @Autowired
    RabbitTemplate rabbitTemplate;
    @Autowired
    ReturnOrderServiceImpl returnOrderService;
    @RequestMapping("selectAllReturn")
    public List<OrderReturn> select(){
        return returnOrderService.selectAllReturn();
    }

    @PostMapping("selectAllById")
    public List<OrderReturn> selectAllById(OrderReturn orderReturn){
        List<OrderReturn> orderReturns = returnOrderService.selectAllById(orderReturn);
        return orderReturns;
    }
    @RequestMapping("selectOrder")
    public List<OrderReturn> selectOrder(OrderReturn orderReturn){
        List<OrderReturn> orderReturns = returnOrderService.selectOrder(orderReturn);
        System.out.println("orderReturns = " + orderReturns);
        return orderReturns;
    }

}
